package com.czz.common.exception;

import com.czz.common.vo.R;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: NotFoundException
 * @Author Czz
 * @Date 2020/3/9
 * @Time 17:48
 **/
@RestController
public class NotFoundException implements ErrorController {

    private static final String ERROR_PATH = "/error";

    @Override
    public String getErrorPath() {
        return ERROR_PATH;
    }

    @RequestMapping(ERROR_PATH)
    public R error(){
        return R.setResult(ResultCodeEnum.NOT_FOUND);
    }
}
